expander: center the arrow
authorMatthias Clasen <mclasen@redhat.com>
Thu, 14 Jan 2016 12:33:04 +0000 (07:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 14 Jan 2016 12:35:59 +0000 (07:35 -0500)
In lieu of more sophisticated alignment, we need to at least
center the arrow allocation wrt to the label.

gtk/gtkexpander.c

index aa80567b1dcad6702584e72cef4e5b5bf8b86ac2..28173cca52591733eb8de732d2b964a292337ad1 100644 (file)
@@ -817,7 +817,7 @@ gtk_expander_allocate_title (GtkCssGadget        *gadget,
       else
         label_allocation.x = allocation->x + label_xoffset;
 
-      label_allocation.y = allocation->y;
+      label_allocation.y = allocation->y + MAX (0, (arrow_height - label_height) / 2);
       label_allocation.height = label_height;
 
       gtk_widget_size_allocate (priv->label_widget, &label_allocation);
@@ -833,7 +833,7 @@ gtk_expander_allocate_title (GtkCssGadget        *gadget,
     arrow_allocation.x = allocation->x + allocation->width - arrow_width;
   else
     arrow_allocation.x = allocation->x;
-  arrow_allocation.y = allocation->y;
+  arrow_allocation.y = allocation->y + MAX (0, (label_height - arrow_height) / 2);
   arrow_allocation.width = arrow_width;
   arrow_allocation.height = arrow_height;